home *** CD-ROM | disk | FTP | other *** search
/ FishMarket 1.0 / FishMarket v1.0.iso / fishies / 426-450 / disk_426 / conman / conman.doc < prev    next >
Text File  |  1992-05-06  |  25KB  |  460 lines

  1.                                ConMan V1.3e
  2.                Copyright © 1987, 1988-1990 by William S. Hawes
  3.    
  4.    ConMan is a replacement console handler which provides line editing and
  5.    command history to any software using CON: windows.  It runs under
  6.    AmigaDOS V1.2 and later, and is completely transparent to other software.
  7.    After ConMan has been activated, all CON: windows opened by AmigaDOS will 
  8.    automatically use the ConMan handler.  This includes the console windows
  9.    opened by NEWCLI or NewShell as well as any data input/output windows 
  10.    that your other software may use.
  11.    
  12.    ConMan 1.3e will request a character-mapped console if run under AmigaDOS
  13.    2.0 to enable the improved refreshing and cut-and-paste features.
  14.  
  15.    Features new to ConMan V1.3 include the CNN: handler for invisible,
  16.    non-blocking type-ahead, the CNX: (extensible) handler for use of the
  17.    serial device as a console, improved editing of long lines, and support
  18.    for superbitmap windows.  ConMan also now supports deferred opening, in
  19.    which the console window is not actually opened until a read or write
  20.    request is received.
  21.    
  22.    As was the case with prior releases, ConMan is distributed as shareware
  23.    (user-supported software).  Shareware is a welcome alternative to the 
  24.    high costs of commercial software, but it only works if the user keeps
  25.    their end of the bargain.  I hope you'll do your part to support ConMan
  26.    and other shareware products.
  27.    
  28.    
  29.                           ----- Line Editing -----
  30.    ConMan allows you to edit the active (command) line using the left- and
  31.    right-arrow keys for cursor positioning.  The shifted left-arrow key 
  32.    skips to the beginning of the current or previous word, and the shifted 
  33.    right-arrow key skips to the start of the next word.
  34.    
  35.    ConMan supports both insert and overstrike editing modes.  The CTRL-A
  36.    key toggles between the two modes, and the CTRL-^ key unconditionally
  37.    selects insert mode.  The default input mode is insert, but you can set
  38.    the global -o flag to select overstrike mode.  The input mode normally
  39.    reverts to the default mode each time you press RETURN, but the global
  40.    -s ("sticky") flag will cause the mode to remain set until you change it
  41.    explicitly.
  42.    
  43.    You can select insert or overstrike mode when you first install ConMan,
  44.    and can change it at any time using the SetCMan command utility.  Try 
  45.    experimenting to see which input mode you like best, but note that the
  46.    input modes are global and therefore apply to ALL ConMan windows.  Refer
  47.    to the paragraph on installation for a list of the global option flags.
  48.    
  49.    There are several keys that can be used to delete characters, words, or 
  50.    the entire line.  The DEL key deletes the character under the cursor, 
  51.    and the BACKSPACE key deletes the character to the left of the cursor.  
  52.    CTRL-Y deletes from the cursor position to the end of the line, and 
  53.    CTRL-U deletes from the cursor to the start of the line.  CTRL-X deletes
  54.    the entire line, in keeping with the default CON: device.
  55.     
  56.    Function keys F7 and F8 can be used to delete words in the backwards and 
  57.    forwards direction, respectively.  They work just like the shifted left- 
  58.    and right-arrow keys except that the characters are deleted.
  59.    
  60.    CTRL-Z deletes both the current line and any lines that have been typed
  61.    ahead (but not yet read); this is very handy if you want to completely 
  62.    abandon all typed-ahead lines.  CTRL-R provides a less drastic recall 
  63.    by posting the typed-ahead lines back to the command line.  CTRL-W clears
  64.    the entire window and then redisplays the active line.
  65.    
  66.    The Undo Buffer.
  67.    Suppose that you're editing a line and you accidentally hit the up- or
  68.    down-arrow key.  You've just lost the line, right?  Not at all --- just
  69.    press the CTRL-- (control-minus) key and the former line will be posted
  70.    back to the command line, with the cursor right where you left it!
  71.    
  72.    There is no limit to the number of lines that can be undone, but only
  73.    lines that have been changed are added to the undo buffer.  All "undo"
  74.    lines are discarded when you finally enter RETURN.
  75.    
  76.    Flow Control.
  77.    CTRL-S and CTRL-Q have been implemented to hold and release the screen
  78.    output, respectively.  After pressing the CTRL-S key, all output to the
  79.    window will be held until you release it with a CTRL-Q.  ConMan will
  80.    "beep" the display if you try to type with CTRL-S in effect, in order
  81.    to provide some visual indication that output is held.
  82.    
  83.    End-of-File.
  84.    ConMan recognizes the CTRL-\ character as an end-of-file and sends a
  85.    zero-length block to the task reading from the handler.  CTRL-\ can be
  86.    used to terminate a copy operation.
  87.    
  88.    All characters not explicitly required for editing purposes are passed
  89.    on to the command line.  In order to provide a consistent display, 
  90.    characters that might cause interference with the display (like CTRL-L)
  91.    are rendered as a caret (^) followed by the uppercase alphabetic
  92.    character.  The CTRL-N (shift-in) and CTRL-O (shift-out) characters are
  93.    supported by ConMan; these are non-printable by themselves, but serve
  94.    to select and unselect the alternate character set.  Miscellaneous
  95.    non-printable characters are displayed as a hash mark.
  96.    
  97.    ConMan now allows control sequences can be entered incrementally.  For
  98.    example, entering ESC, [, 0, and ~ will simulate the effect of an F1 key.
  99.    
  100.    
  101.                           ----- Command History -----
  102.    ConMan "remembers" the commands that you type and lets you recall them
  103.    sequentially using the up- and down-arrow keys.  If you go past the line
  104.    you want, the down-arrow key will retrieve the next (more recent) line.  
  105.    The shifted up-arrow key recalls the oldest line, and shifted down-arrow 
  106.    recalls the most recent line.  The CTRL-B key clears the history buffer.
  107.    
  108.    The history buffer is organized as a fixed-length memory pool with a
  109.    default length of 488 bytes.  New lines are inserted at one end, and 
  110.    the oldest lines are pushed off the other end to make room.  The number
  111.    of lines that can be saved depends on their lengths, but is generally in
  112.    the range of 25 to 30.  The default size can be changed when you install 
  113.    ConMan by using the -b option followed by the desired size in bytes.  
  114.    For example, the command "conman -c -b1000" would install ConMan with a 
  115.    1000-byte history buffer.
  116.    
  117.    ConMan maintains the history in one of two modes.  In the default mode, 
  118.    recalled lines are not reentered into the history buffer unless the line
  119.    was "touched," and the history index pointer is left positioned at the
  120.    retrieved line.  This mode is convenient if you often go back into the
  121.    buffer to retrieve sequences of commands.
  122.    
  123.    In "true history" mode, every line is reentered into the history buffer,
  124.    even if it wasn't modified after being recalled.  The history pointer is
  125.    always reset (to the most recent line) whenever a line is added to the
  126.    buffer.
  127.    
  128.    The history mode can be selected when ConMan is installed or by using the
  129.    "SetCMan CON: -t" command.  Note that ConMan checks for duplicate entries
  130.    irrespective of whether standard or "true" history is selected.  If the
  131.    current line matches the previous line entered, the line is not reentered.
  132.    
  133.    Minimum Line Length.
  134.    You can define a minimum line length to be saved in the history buffer by
  135.    using the -LNNN option.  The number following the -L is the limit at or
  136.    below which lines will not be saved; the default value is 0.  For example,
  137.    "conman -c -L2" will ignore lines of 2 or fewer characters.
  138.    
  139.    Wrap-Around History.
  140.    If you prefer to maintain the command history as a circular buffer rather 
  141.    than as a stack, try setting the -wrap option with ConMan or SetCMan.  
  142.    The index will "wrap-around" when it hits the top or bottom of the stack.
  143.    
  144.    Versions 1.1 and later of ConMan include a command called "History" to
  145.    save, load, or display the history buffer.  Refer to the "Extras.doc" 
  146.    file for more information.
  147.    
  148.    
  149.                           ----- Function Keys -----
  150.    ConMan has several additional editing functions and window control options
  151.    that use the function keys.
  152.    
  153.    Key F1 shrinks ("iconifies") the window to its minimum size, and key F2 
  154.    "zooms" the window to its maximum size (usually the entire screen.)  Both
  155.    keys act as toggles, and shrunken windows may be zoomed (and vice-versa.)
  156.    ConMan V1.3 provides a minor enhancement to the zoom feature:  if the 
  157.    window is not exactly at the top of the screen when F2 is hit, it will be
  158.    positioned one pixel down from the top, rather than right at the top.  
  159.    This allows you to slide the screen even if the window covers most of it.
  160.    If the window was opened without a sizing gadget, neither F1 or F2 will 
  161.    have any effect.
  162.    
  163.    Keys F5 and F6 are used to search for commands.  If you type a partial 
  164.    command line and then press F6, ConMan searches in the up-arrow direction 
  165.    for a line matching up to the cursor position.  You can move the cursor
  166.    to the right to constrain the search.  Key F5 works similarly in the 
  167.    down-arrow direction.
  168.    
  169.    Keys F7 and F8 delete words in the backwards and forwards direction.  
  170.    They operate just like the shifted left- and right-arrow keys, except
  171.    that the words are deleted rather than just skipped over.
  172.    
  173.    Function key F9 moves the screen to the front or back of the display, 
  174.    and F10 moves the window to the front or back.  Both keys act as toggles 
  175.    provided that you don't deactivate the window or screen.  These keys are
  176.    useful when you're working with multiple windows or screens and need to 
  177.    peek at the one in back.
  178.    
  179.    
  180.                         ----- Window Definitions -----
  181.    ConMan accepts the standard AmigaDOS window specifications.  For example,
  182.    "CON:160/50/320/100/MyWindow" specifies a window 320x100 pixels in size,
  183.    beginning in position (160,50).  The numeric parameters are truncated
  184.    against the maximum screen size, so a larger-than-normal window may be
  185.    safely specified (for those of you using "morerows").  The default size
  186.    is the full screen width and height.  ConMan sets the minimum window size
  187.    to allow room for the close gadget and depth gadgets.
  188.    
  189.    Various Intuition options and gadgets can be selected by including a list
  190.    of attributes after the window title.  Here's how it works:  put another 
  191.    slash ("/") after the window title, and follow it with any of the
  192.    attribute options listed below.
  193.    
  194.       Option Character                 Default Value   
  195.       ----------------                 -------------
  196.       A <==> Activate                  Activated
  197.       B <==> BackDrop                  Not a backdrop
  198.       C <==> Close gadget              No close gadget
  199.       D <==> Depth gadgets             Depth gadgets
  200.       M <==> Move (drag) gadget        Drag gadget
  201.       N <==> NoBorder                  Border (sorry, "B" was used)
  202.       R <==> Refresh (SMART/SIMPLE)    Smart refresh (simple under 2.0)
  203.       S <==> Sizing gadget             Sizing gadget
  204.       Z <==> Zero-Zero                 Not a GZZ
  205.    
  206.    Each option character will TOGGLE the corresponding window attribute,
  207.    so if you include an option twice, it will cancel the effect.  Any 
  208.    unrecognized attribute characters are ignored, and the closing slash is 
  209.    optional.  My apologies to those who wanted a slash in the title.
  210.  
  211.    Under 2.0 ConMan 1.3e will request a character-mapped simple-refresh
  212.    console window to enable the cut-and-paste features.
  213.    
  214.    Examples: CON:10/10/300/100/Behind/nb/   a borderless backdrop window.
  215.              CON:10/10/300/100/Fixed/acm    a nonactivated window, with a 
  216.                                             close gadget, that won't budge.
  217.    
  218.    You can select the colors for the window's titlebar area by appending a
  219.    '/' to the attribute list and specifying the "detail pen" and "block pen"
  220.    color values; the color numbers are listed below.
  221.  
  222.       Pen Number  Color
  223.       ----------  -----
  224.           0       Blue
  225.           1       White
  226.           2       Black
  227.           3       Red
  228.  
  229.    For example, "CON://640/100/Colors!/ac/23" would specify a window with
  230.    black letters (the detail pen) on a red titlebar (the block pen).
  231.  
  232.  
  233.                           ----- Installation ----
  234.    To install ConMan you'll need to copy a few files to your system disk,
  235.    but don't worry --- they're all small.  Install the file "Conhandler"
  236.    in your L: directory, to keep those bigger handlers company.  Then copy
  237.    the file "conhandler.library" into your LIBS: directory.  Now copy the 
  238.    commands "ConMan", "SetCMan", and "History" to your C: directory; the 
  239.    other command programs are optional.  The included "ExecuteMe" file will
  240.    handle the installation if you'd rather do it automatically.
  241.    
  242.    Once these files have been installed, issue the command "conman -c" to 
  243.    activate the handler.  After you've activated ConMan, open a CLI window
  244.    using NEWCLI and check to make sure that the new window has line editing
  245.    and command history.  Once everything is working properly, you should
  246.    place the "conman -c" command in your startup-sequence so that it's 
  247.    always available.
  248.    
  249.    NOTE:  ConMan affects only those windows opened AFTER you activate it!
  250.    It would be very impolite indeed to pull the old handler out from under 
  251.    the existing console windows.
  252.    
  253.    You can specify several command line arguments with the ConMan command:
  254.    
  255.       Code     Action
  256.       ------   ------
  257.       -bNNNN   select buffer size NNNN bytes
  258.       -c       install as CON: (the default)
  259.       -lNNN    minimum length to save
  260.       -o       select overstrike mode
  261.       -r       install as RAW:
  262.       -s       select "sticky" mode
  263.       -t       maintain "true history"
  264.       -w       select "wrap-around" history
  265.    
  266.    These command options can appear in any order and remain in effect until
  267.    you reboot the computer.  The options established by the ConMan command
  268.    are the global defaults inherited when each device is opened.  Subsequent
  269.    changes must be made using the SetCMan command described below.
  270.    
  271.    A separate utility program called "SetCMan" has been provided to modify 
  272.    the global options or device attributes.  You can use SetCMan to change
  273.    the -o, -s, -t, or -w options at any time, and the device attributes -d
  274.    (deferred opening) and -n (non-blocking) can be set if no devices of the
  275.    specified type are open.  To set the options on a device-by-device basis,
  276.    a device name must supplied with the command, as the examples illustate.
  277.    Examples: setcman ?            ; displays the template
  278.              setcman -o -s -t     ; overstrike, sticky, true history
  279.              setcman CON: -n      ; set CON: for non-blocking
  280.              setcman CNC: -d -w   ; CNC: deferred opening with wrap history
  281.    
  282.    If you usually operate from Workbench and only occasionally need a CLI,
  283.    you can activate ConMan by using the icons.  First double-click on the 
  284.    "LoadLib" icon to load the conhandler library, and then activate ConMan
  285.    by double-clicking the "ConMan" icon.  The next CLI you open should now
  286.    have the line editing and command history provided by ConMan.
  287.    
  288.    
  289.                           ----- Distribution -----
  290.    This program is distributed as shareware (user-supported software) to 
  291.    Amigoid life-forms everywhere!  Make sure your friends get a copy.  
  292.    Your contributions are greatly appreciated and will help me maintain 
  293.    ConMan as well as develop new products.  Send all correspondence to:
  294.    
  295.          By Mail:                      By Telephone or EMail:
  296.          -----------------             ------------------------------
  297.          William S. Hawes              Phone: (508) 568-8695
  298.          P.O. Box 308                  BIX: whawes
  299.          Maynard, MA 01754             CIS: 72230,267
  300.          USA                           PLINK: whawes
  301.  
  302.    The suggested contribution is $10 (based on an earlier survey), but any 
  303.    amount is welcome.  The number of registered ConMan users has increased
  304.    significantly since the last release, but is still far below what would
  305.    be expected for a comparable commercial product.
  306.    
  307.    Commercial vendors are welcome to include ConMan with their products,
  308.    provided that it's noted as being shareware and that the documentation 
  309.    accompanies the software.
  310.    
  311.    
  312.                           ----- Other Products -----
  313.    If you like ConMan well enough to have read this far, rush down to your
  314.    local Amiga dealer and buy a copy of my commercial products!  ARexx and
  315.    WShell are available at better dealers**, or you can order them directly 
  316.    from the above address.  VISA and MasterCard are accepted.
  317.    
  318.    ARexx is a multitasking implementation of the REXX language, a high-level
  319.    interpreted language designed for macro-processing.  ARexx has become the
  320.    de facto standard for inter-program communications and can be used as the
  321.    macro language for any software package that includes an ARexx interface.
  322.    It's both powerful and easy-to-learn, and is well documented in a 150-page
  323.    manual.  ................................. Only $49.95 (plus $2 shipping)
  324.    
  325.    WShell V1.2 is an enhanced but highly compatible CLI/Shell replacement.
  326.    It offers aliases, built-in and resident commands, concurrent command
  327.    piping (as in pgm1 | pgm2 | ... | pgmN), a customized prompt and window
  328.    titlebar, transparent support for REXX macro programs, an "implicit" CD
  329.    command, PushCD/PopCD commands, script-bit support, filename-completion,
  330.    an ExecIO command for use with ARexx, and lots of other features.  It's
  331.    even well-documented with a highly readable 80+ page manual.  (And now
  332.    available in a German language edition as well!)  Isn't it time to put
  333.    some mussel into your command environment?  Just 50 clams (+ $2 shipping)
  334.    
  335.    ** better dealers are those that stock ARexx and WShell.
  336.    
  337.    
  338.                           ----- Further Notes -----
  339.    ConMan also accepts window specifications in the form "CON:w20480", where
  340.    the hex digits following the "w" are the absolute address of an Intuition
  341.    window pointer.  This allows you to attach a console handler to a window
  342.    in a multitasking-safe way (unlike the methods that require setting a
  343.    field in the DOS device list).  If you're writing in C, you could use
  344.    the following sequence to open a window and attach a DOS console to it:
  345.    
  346.          window = OpenWindow(&newwindow);   /* get a window          */
  347.          sprintf(buffer,"CON:W%x",window);  /* build the name string */
  348.          file  = Open(buffer,MODE_OLDFILE); /* open a console stream */ 
  349.    
  350.    You can open a console window on a custom screen by passing the hex
  351.    address of the screen preceded by an "S" in the specification string,
  352.    as in "CON:S123abc/10/10/300/100/MyWindow."  ConMan will accept "S*" as
  353.    a shorthand notation for the frontmost screen, so a specification like
  354.    "CON:S*/0/0/300/100/Front" would open on whichever screen was in front.
  355.    Watch out for using S* in a double quoted-string, though, since the * is
  356.    the default AMigaDOS escape character.  If your console specification 
  357.    includes spaces and thus needs to be quoted, you'll need to use S** as
  358.    in this example:
  359.       1> newcli "CON:S**/0/0/640/100/My Window/a/23"
  360.  
  361.    In addition, ConMan now supports superbitmap windows as well.  The bitmap
  362.    structure is passed as a "B" followed by the hex address, as for example
  363.    "CON:B123ABC/0/0/300/100/Super!".  The console device currently has some
  364.    bugs related to using superbitmaps (for example, the cursor disappears),
  365.    but this feature may be handy anyway.
  366.    
  367.    
  368.    Other Names.
  369.    ConMan is actually several DOS handlers rolled into one, and it selects
  370.    the desired mode of operation by looking at the name used to open it.  
  371.    The four special names recognized are CND:, CNN:, CNX:, and PIP:, and all
  372.    other names are considered equivalent to CON:.
  373.    
  374.    In order to use ConMan under any name other than CON:, you'll first need
  375.    to mount the handler using one of the supplied mountlist entries.  The
  376.    mountlist file "Con-MountList" should be copied to your DEVS: directory,
  377.    and then the desired mount command issued.  For example, to define ConMan
  378.    as the CNC: device, issue the command
  379.       1> mount CNC: from DEVS:Con-MountList
  380.    Once you've done this, you can get a ConMan window by specifying a name
  381.    like CNC://640/100/MyWindow.  This allows the CON: definition to be left
  382.    intact, in case there are any incompatibilities between ConMan and your
  383.    existing software (but please let me know of any problems!)
  384.  
  385.    Warning: Some versions of the ARP mount command have a known bug that
  386.    causes the console handler to open up in RAW mode.  Use the standard
  387.    mount command if you suspect a problem.
  388.    
  389.    The CND: handler uses the deferred opening mode by default.  Deferred
  390.    opening means that the window is not actually opened until it is read
  391.    from or written to; this provides a cosmetic improvment for programs
  392.    that need a window to report error messages.
  393.  
  394.    The CNN: handler operates in a mode that allows invisible (non-blocking)
  395.    type-ahead.  After the line you enter has been read, any further input 
  396.    is not displayed until the command shell (or other software) again reads
  397.    from the console.  This gives unimpeded access to whatever software is
  398.    writing to the console.  
  399.    Example:  NewCLI "CND://640/100/VAX Head!"
  400.    
  401.    The CNX: handler provides extensibility by allowing you to specify any
  402.    EXEC-level device for the console display.  The display device name and
  403.    unit are passed immediately following the handler name, as in 
  404.    "CNX:device-name/unit".  For example, you could specify the serial device
  405.    as "CNX:serial.device/0", providing an AUX:-like handler with full line
  406.    editing and command history.  The display device must support the 
  407.    standard ANSI control sequences on read and write.
  408.    Example:  NewCLI CNX:serial.device/0
  409.    
  410.    ConMan is also a pipe-handler responding to the name PIP:NNNN, where
  411.    NNNN is the "capacity" of the pipe.  It must be opened using a private
  412.    packet called ACTION_DOUBLE (value 2000L), and the filehandle you get
  413.    from a call to Open("PIP:",2000) counts for two and so can be cloned
  414.    by your program.  After allocating a filehandle structure (using the
  415.    AmigaDOS memory conventions), just copy the filehandle from Open()
  416.    into the new structure --- and don't forget to Close() both of them!
  417.    My WShell command shell uses the ConMan PIP: device as its pipe handler.
  418.    
  419.    
  420.    Break Signals.
  421.    Break signals are generated by typing a control-C, D, E, or F and can be
  422.    delivered to any task that has opened, read from, or written to ConMan.
  423.    The break-signal handling in ConMan is much more sophisticated than that
  424.    in the standard CON: handler, and additional improvements have been made
  425.    in V1.3 to eliminate the possibility of signalling a non-existent task.
  426.    ConMan is able to signal a task that has only read from or written to the
  427.    console -- even if it hasn't opened it -- by holding the break event
  428.    until a read or write request arrives.
  429.    
  430.    In addition to the break signals generated by user input, ConMan will
  431.    send a control-C break to any task that continues to write to the handler
  432.    when it's trying to close.  ConMan is in such a "closing" state after the
  433.    close gadget on a window has been hit, or if it is a PIP: pipe with only
  434.    one open remaining.  This automatic "break-on-write" provides a way of
  435.    propagating a signal back through a series of piped programs.
  436.  
  437.    
  438.    Keymapping.
  439.    ConMan supports the Amiga's keymapping facility, which allows you to 
  440.    reassign the editing functions to the keys of your choice.  To do this, 
  441.    you must first construct a keymap either in assembly language or with
  442.    the help of a keymap editor.  You can then load the keymap using the 
  443.    SetMap program on your Workbench disk.  By default SetMap makes a keymap 
  444.    global; if you want to use a special keymap from just one CLI, you can 
  445.    use the included KeyMap command to define the desired map.  KeyMap with 
  446.    no arguments will display a list of the available keymaps.
  447.    
  448.    
  449.                               ----- Bugs -----
  450.    All known bugs have been fixed in this release, so you should find it to 
  451.    be very reliable.  If you do find a problem, PLEASE report it so I can 
  452.    fix it!!
  453.    
  454.                         ----- Acknowledgements -----
  455.    Special thanks to John Toebes and the Software Distillery for lots of
  456.    great suggestions, to Jeff White for the handsome icons, and to the many
  457.    contributors who made ongoing development and improvements possible.
  458.    
  459.                               -- Bill Hawes (October, 1990)
  460.